import QtQuick 1.0

Rectangle {
    id:root
    width: 360
    height: 640
    y:640
    color: "black"
    opacity: 0.8

    property bool show : false
    property alias content : content.text
    property int code : -1
    property alias acceptVisible : buttonAccept.visible
    property alias quitVisible : buttonQuit.visible

    function showDialog()
    {
        show = true;
    }
    function hideDialog()
    {
        show = false;
    }


    onShowChanged: {
        y = show ? 640 - root.height : 640

    }



    signal accept()
    signal reject()


    Behavior on y {
        NumberAnimation {
            easing.type: Easing.InOutQuart
            duration : 500

        }
    }


    Text {
        id:content
        width: 300
        anchors.centerIn: parent
        color: "white"
        font.family: "UbuntuBeta"
        font.pixelSize: 14
        horizontalAlignment: Text.AlignHCenter
    }

    Row {
        anchors.horizontalCenter: parent.horizontalCenter
        anchors.bottom: parent.bottom
        anchors.bottomMargin: 30
        spacing: 200
        Button {
            id:buttonQuit
            source: "../gfx/quit_hover.png"
            onClicked: root.reject()

        }

        Button {
            id:buttonAccept
            source: "../gfx/valid_hover.png"
            onClicked: root.accept()

        }
    }
}
